/* Define if _NL_TIME_FIRST_WEEKDATE is available */
#mesondefine HAVE__NL_TIME_FIRST_WEEKDAY
-/* Define if you have the `g_desktop_app_info_launch_uris_as_manager_with_fds` function */
-#mesondefine HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS
-
/* Define if fdwalk is available in libc */
#mesondefine HAVE_FDWALK
cdata.set('HAVE_PIPEWIRE', have_pipewire)
cdata.set('HAVE_SYSTEMD', have_systemd)
-# New API added in glib-2.57.2
-cdata.set('HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS',
- cc.has_function('g_desktop_app_info_launch_uris_as_manager_with_fds',
- dependencies : gio_dep)
-)
cdata.set('HAVE_FDWALK', cc.has_function('fdwalk'))
cdata.set('HAVE_MALLINFO', cc.has_function('mallinfo'))
cdata.set('HAVE_MALLINFO2', cc.has_function('mallinfo2'))
meta_context_restore_rlimit_nofile (meta_context, NULL);
}
-#if !defined(HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS) && defined(HAVE_SYSTEMD)
-/* This sets up the launched application to log to the journal
- * using its own identifier, instead of just "gnome-session".
- */
-static void
-app_child_setup (gpointer user_data)
-{
- const char *appid = user_data;
- int res;
- int journalfd = sd_journal_stream_fd (appid, LOG_INFO, FALSE);
- ShellGlobal *shell_global = shell_global_get ();
-
- if (journalfd >= 0)
- {
- do
- res = dup2 (journalfd, 1);
- while (G_UNLIKELY (res == -1 && errno == EINTR));
- do
- res = dup2 (journalfd, 2);
- while (G_UNLIKELY (res == -1 && errno == EINTR));
- (void) close (journalfd);
- }
-
- child_context_setup (shell_global);
-}
-#endif
-
static void
wait_pid (GDesktopAppInfo *appinfo,
GPid pid,
flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD |
G_SPAWN_LEAVE_DESCRIPTORS_OPEN;
-#ifdef HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS
/* Optimized spawn path, avoiding a child_setup function */
{
int journalfd = -1;
if (journalfd >= 0)
(void) close (journalfd);
}
-#else /* !HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS */
- ret = g_desktop_app_info_launch_uris_as_manager (app->info, NULL,
- context,
- flags,
-#ifdef HAVE_SYSTEMD
- app_child_setup, (gpointer)shell_app_get_id (app),
-#else
- child_context_setup, shell_global,
-#endif
- wait_pid, NULL,
- error);
-#endif /* HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS */
g_object_unref (context);
return ret;